DEFINITION MODULE MenuMgr;

(*
AES Menu Manager.

UK __DATE__ __TIME__
*)

(*DEF_SWITCHES*)

FROM RcMgr  IMPORT GPnt;
FROM PORTAB IMPORT SIGNEDWORD,UNSIGNEDWORD,UNSIGNEDLONG,ANYBYTE;

IMPORT AES;

(* [Menu] Manager: Show Menu [Bar], AES(30) ****************************** *)

CONST MenuErase   =   0;  MenuHide = 0;
      MenuDisplay =   1;  MenuShow = 1;
      MenuInstl   = 100; (* MagX *)
      MenuInquiry =  -1;

TYPE TreePtr = AES.TreePtr;

PROCEDURE MenuBar(PTree: TreePtr;
                  Show : SIGNEDWORD): SIGNEDWORD;

(* [Menu] Manager: [Check] Menu [I]tem, AES(31) ****************************)

TYPE ObjectIndex = AES.ObjectIndex;

PROCEDURE MenuICheck(PTree: TreePtr;
                     Item : ObjectIndex;
                     Check: BOOLEAN);

(* [Menu] Manager: [Enable] Menu [I]tem, AES(32) ***************************)

PROCEDURE MenuIEnable(PTree : TreePtr;
                      Item  : ObjectIndex;
                      Enable: BOOLEAN);

(* [Menu] Manager: Show [Normal] [T]itle, AES(33) **************************)

PROCEDURE MenuTNormal(PTree : TreePtr;
                      Title : ObjectIndex;
                      Normal: BOOLEAN);

(* [Menu] Manager: Set Menu [Text], AES(34) ********************************)

PROCEDURE MenuText(    PTree: TreePtr;
                       Item : ObjectIndex;
                   VAR Text : ARRAY OF CHAR);

(* [Menu] Manager: [Register] Accessory, AES(35) ***************************)

PROCEDURE MenuRegister(    Id   : SIGNEDWORD;
                       VAR MName: ARRAY OF CHAR): SIGNEDWORD;

(* [Menu] Manager: [Unregister] Accessory, AES(36) *************************)

PROCEDURE MenuUnregister(Id: SIGNEDWORD);

(* [Menu] Manager: [Popup], AES(36) ****************************************)

TYPE Menu = RECORD
              MnTree    : TreePtr;
              MnMenu    : ObjectIndex;
              MnItem    : ObjectIndex;
#if linear
#if fill_byte
              FillByte: ANYBYTE;
#endif
#endif
              MnScroll  : BOOLEAN;
#if intel
#if fill_byte
              FillByte: ANYBYTE;
#endif
#endif
              MnKeyState: AES.SpecialKey;
            END;

PROCEDURE MenuPopup(VAR PMenu: Menu;
                        Pos  : GPnt;
                    VAR PData: Menu): BOOLEAN;

(* [Menu] Manager: Set [Click] Mode, AES(37) *******************************)

PROCEDURE MenuClick(Click: BOOLEAN;
                    SetIt: BOOLEAN);

(* [Menu] Manager: [Attach] Submenu, AES(37) *******************************)

PROCEDURE MenuAttach(    Flag : UNSIGNEDWORD;
                         PTree: TreePtr;
                         Item : ObjectIndex;
                     VAR PData: Menu): BOOLEAN;

(* [Menu] Manager: Set [Start] [I]tem, AES(38) *****************************)

PROCEDURE MenuIStart(Flag : UNSIGNEDWORD;
                     PTree: TreePtr;
                     IMenu: ObjectIndex;
                     Item : ObjectIndex): BOOLEAN;

(* [Menu] Manager: [Settings], AES(39) *************************************)

TYPE MnSet = RECORD
               Display: UNSIGNEDLONG;
               Drag   : UNSIGNEDLONG;
               Delay  : UNSIGNEDLONG;
               Speed  : UNSIGNEDLONG;
               Height : UNSIGNEDWORD;
             END;

PROCEDURE MenuSettings(    Flag  : UNSIGNEDWORD;
                       VAR Values: MnSet);

END MenuMgr.
